﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace AMS.DataAccess.Dao
{
       /// <summary>
    /// 对业务实体操作的接口
    /// </summary>
    /// <typeparam name="T">带数据库表映射的实体对象</typeparam>
    public interface IBusinessObjectDao<T>
        where T : class
    {
        /// <summary>
        /// 添加实体
        /// </summary>
        /// <param name="bo"></param>
        /// <returns></returns>
        int Add(T bo);

        /// <summary>
        /// 更新实体
        /// </summary>
        /// <param name="bo"></param>
        /// <returns></returns>
        int Update(T bo);

        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="bo"></param>
        /// <returns></returns>
        int Delete(T bo);

        /// <summary>
        /// 获取所有的实体列表
        /// </summary>
        /// <returns></returns>
        List<T> GetList();

        /// <summary>
        /// 获取所有的实体列表
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="sort"></param>
        /// <returns></returns>
        List<T> GetList(string filter, string sort);

        /// <summary>
        /// 获取所有的实体列表
        /// </summary>
        /// <param name="columns"></param>
        /// <param name="filter"></param>
        /// <param name="sort"></param>
        /// <returns></returns>
        List<T> GetList(string columns, string filter, string sort);

        /// <summary>
        /// 获取列表信息
        /// </summary>
        /// <returns></returns>
        DataTable GetTable();

        /// <summary>
        /// 获取列表信息
        /// </summary>
        /// <param name="filter"></param>
        /// <param name="sort"></param>
        /// <returns></returns>
        DataTable GetTable(string filter, string sort);

        /// <summary>
        /// 获取列表信息
        /// </summary>
        /// <param name="columns"></param>
        /// <param name="filter"></param>
        /// <param name="sort"></param>
        /// <returns></returns>
        DataTable GetTable(string columns, string filter, string sort);
    }
}
